script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle;
	let num = GetArgument;
	let imgEnemy; 
	if(num==1)
	{
		imgEnemy=csd~"..\lib\fairy_red.png";
	}
	if(num==2)
	{
		imgEnemy=csd~"..\lib\fairy_blue.png";
	}

	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(120);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(3);
	Tmain;
	}

    @MainLoop {
	SetCollisionA(GetX(),GetY(),32);
	yield;
    }

        @DrawLoop {
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		DrawMagicCircle("WHITE",0.30);
	}

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,1,0.3);
		FinalizeItemAndShotnum(2);
        } 

task Tmain
{
yield;
Stage3FairyCommonTask;
OutDamageRateZero;
AutoErazeTime(900);
GetDamege;
MagicColor;
move;

alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}

}


task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
}

task shotM
{
wait(60);
loop(5)
{
let angle=GetAngleToPlayer;
	ascent(i in 2..8)
	{
		GroundCreateShot01(GetX,GetY,4+i*0.75,angle,9,5);
		GroundCreateShot01(GetX,GetY,4+i*0.75,angle+3,9,5);
		GroundCreateShot01(GetX,GetY,4+i*0.75,angle-3,9,5);
		wait(3);
	}
wait(45);
}
}
///////////////////////////////////////////////
task shotE
{
wait(60);
loop(5)
{
let angle=GetAngleToPlayer;
	ascent(i in 2..8)
	{
		GroundCreateShot01(GetX,GetY,3.5+i*0.75,angle,9,5);
		GroundCreateShot01(GetX,GetY,3.5+i*0.75,angle+3,9,5);
		GroundCreateShot01(GetX,GetY,3.5+i*0.75,angle-3,9,5);
		GroundCreateShot01(GetX,GetY,3.5+i*0.75,angle+6,9,5);
		GroundCreateShot01(GetX,GetY,3.5+i*0.75,angle-6,9,5);
		wait(3);
	}
wait(45);
}
}
/////////////////////////////////////////////////
task shotA
{
wait(60);
loop(5)
{
let angle=GetAngleToPlayer;
	ascent(i in 2..8)
	{
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle+3,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle-3,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle+6,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle-6,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle+9,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle-9,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle+12,9,5);
		GroundCreateShot01(GetX,GetY,5+i*0.75,angle-12,9,5);
		wait(3);
	}
wait(45);
}
}
#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\txt/Stage3FairyCommondata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

#include_script ".\..\txt/EnemyShotData.txt"